package com.zunipe.ftpe;

import com.zunipe.ftpe.util.Utils;

import java.util.ArrayList;
import java.util.List;

public class Config {
    private String hostname;
    private int port;
    private String username;
    private String password;
    private String matchingFormat;
    private List<String> paths;
    private List<String> timePoints;
    private List<String> downloadedFile;

    public Config(String hostname, int port, String username, String password, String matchingFormat) {
        this.hostname = hostname;
        this.port = port;
        this.username = username;
        this.password = password;
        this.matchingFormat = matchingFormat;
        this.paths = new ArrayList<>();;
        this.timePoints = new ArrayList<>(List.of("1:00"));
        this.downloadedFile = new ArrayList<>();
    }

    public String getMatchingFormat() {
        return matchingFormat;
    }

    public void setMatchingFormat(String matchingFormat) {
        this.matchingFormat = matchingFormat;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void addPath(String path) {
        this.paths.add(path);
    }

    public List<String> getPaths() {
        return paths;
    }

    public void setPath(List<String> paths) {
        this.paths = paths;
    }

    public List<String> getTimePoints() {
        return timePoints;
    }

    public void setTimePoints(List<String> timePoints) {
        this.timePoints = timePoints;
    }

    public List<String> getDownloadedFile() {
        return downloadedFile;
    }

    public void setDownloadedFile(List<String> downloadedFile) {
        this.downloadedFile = downloadedFile;
    }

    @Override
    public String toString() {
        return "hostname: " + hostname + "\n" +
                "port: " + port + "\n" +
                "username: " + username + "\n" +
                "password: " + password + "\n" +
                "matchingFormat: " + matchingFormat + "\n" +
                "paths: " + Utils.listToString(paths) + "\n" +
                "timePoints: " + Utils.listToString(timePoints);
    }
}
